package guoanmaker.operator.business.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import guoanmaker.operator.business.model.OperatorRefuselist;


public interface OperatorRefuselistRepository extends  JpaRepository<OperatorRefuselist, String>, JpaSpecificationExecutor<OperatorRefuselist>{

	@Query("select r from OperatorRefuselist r where r.attribution=1")
	public List<OperatorRefuselist>  selectBybusrefuse();
	@Query("select r from OperatorRefuselist r where r.attribution=2")
	public List<OperatorRefuselist>  selectBycommrefuse();
	@Query("select r from OperatorRefuselist r where r.attribution=4")
	public List<OperatorRefuselist>  selectBycommrefusexj();
	@Query("select r from OperatorRefuselist r where r.attribution=1 and r.categoryName=:categoryName")
	public List<OperatorRefuselist>  selectByCategoryName(@Param("categoryName") String categoryName);
	@Query("select r from OperatorRefuselist r where r.attribution=:attribution")
	public List<OperatorRefuselist>  selectByAttribution(@Param("attribution") int attribution);
	@Query("select r from OperatorRefuselist r where r.attribution=2 and r.categoryName=:categoryName")
	public List<OperatorRefuselist>  selectByCommCategoryName(@Param("categoryName") String categoryName);
	@Query("select r from OperatorRefuselist r where r.attribution=4 and r.categoryName=:categoryName")
	public List<OperatorRefuselist>  selectByShelvesCategoryName(@Param("categoryName") String categoryName);
	@Query("select r from OperatorRefuselist r where r.attribution=3 and r.categoryName=:categoryName")
	public List<OperatorRefuselist>  selectByOder(@Param("categoryName") String categoryName);
	
	@Query("select r from OperatorRefuselist r where r.attribution=3")
	public List<OperatorRefuselist>  selectByOrderrefuse();
	@Query("select r from OperatorRefuselist r where r.attribution=5 and r.categoryName=:categoryName")
	public OperatorRefuselist  selectByCategoryNameRoom(@Param("categoryName") String categoryName);
	
}
